package com.wish.g01.finance.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wish.g01.base.dto.CwCheckBatchDetailDto;
import com.wish.g01.base.entity.CwCheckBatchDetail;
import com.wish.g01.base.service.ICwCheckBatchDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wish.g01.common.log.annotation.Log;
import com.wish.g01.common.log.enums.BusinessType;
import com.wish.g01.common.security.annotation.PreAuthorize;
import com.wish.g01.common.core.web.controller.BaseController;
import com.wish.g01.common.core.web.domain.AjaxResult;
import com.wish.g01.common.core.utils.poi.ExcelUtil;
import com.wish.g01.common.core.web.page.TableDataInfo;

/**
 * 对账批次明细（保存对账结果明细的）Controller
 * 
 * @author wish
 * @date 2022-05-28
 */
@RestController
@RequestMapping("/detail")
public class TCwCheckBatchDetailController extends BaseController
{
    @Autowired
    private ICwCheckBatchDetailService tCwCheckBatchDetailService;

    /**
     * 查询对账批次明细（保存对账结果明细的）列表
     */
    @PreAuthorize(hasPermi = "system:detail:list")
    @GetMapping("/list")
    public TableDataInfo list(CwCheckBatchDetailDto dto)
    {
        startPage();
        List<CwCheckBatchDetail> list = tCwCheckBatchDetailService.listAll(dto);
        return getDataTable(list);
    }

    /**
     * 导出对账批次明细（保存对账结果明细的）列表
     */
    /*@PreAuthorize(hasPermi = "system:detail:export")
    @Log(title = "对账批次明细（保存对账结果明细的）", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TCwCheckBatchDetail tCwCheckBatchDetail) throws IOException
    {
        List<TCwCheckBatchDetail> list = tCwCheckBatchDetailService.selectTCwCheckBatchDetailList(tCwCheckBatchDetail);
        ExcelUtil<TCwCheckBatchDetail> util = new ExcelUtil<TCwCheckBatchDetail>(TCwCheckBatchDetail.class);
        util.exportExcel(response, list, "detail");
    }*/

    /**
     * 获取对账批次明细（保存对账结果明细的）详细信息
     */
    @PreAuthorize(hasPermi = "finance:detail:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(tCwCheckBatchDetailService.getById(id));
    }
    /**
     * 新增对账批次明细（保存对账结果明细的）
     */
    /*@PreAuthorize(hasPermi = "system:detail:add")
    @Log(title = "对账批次明细（保存对账结果明细的）", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TCwCheckBatchDetail tCwCheckBatchDetail)
    {
        return toAjax(tCwCheckBatchDetailService.insertTCwCheckBatchDetail(tCwCheckBatchDetail));
    }*/

    /**
     * 修改对账批次明细（保存对账结果明细的）
     */
    /*@PreAuthorize(hasPermi = "system:detail:edit")
    @Log(title = "对账批次明细（保存对账结果明细的）", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TCwCheckBatchDetail tCwCheckBatchDetail)
    {
        return toAjax(tCwCheckBatchDetailService.updateTCwCheckBatchDetail(tCwCheckBatchDetail));
    }*/

    /**
     * 删除对账批次明细（保存对账结果明细的）
     */
    /*@PreAuthorize(hasPermi = "system:detail:remove")
    @Log(title = "对账批次明细（保存对账结果明细的）", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tCwCheckBatchDetailService.deleteTCwCheckBatchDetailByIds(ids));
    }*/
}
